package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class homework {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        String line ;
        while(true){
            System.out.println("请输入exit");
            line = sc.next();
            if(line.equals("exit")){
                break;
            }
        }
        FileOutputStream fos = new FileOutputStream("note.txt");
        byte[] buf = line.getBytes(StandardCharsets.UTF_8);
        fos.write(buf);
        fos.close();
    }
}
